define(['./pathCompute','text!../../pages/base/head.html','text!../../pages/base/slide.html'],function(pathfn, headhtml, slidehtml){  //注意模块的写法  
    pathfn._pathOperate();
    var backFn = function(callback){
    	layui.use(['element','layer'], function(){
    		var element = layui.element,
    		layer = layui.layer;
	    	var _contentOperate = function(){  //载入头部和左边菜单	
				$('#budget-header').html(headhtml);
				$('#budget-slide').html(slidehtml);
				element.init();
			}
		    var _menuOperate = function(callback){  //左侧菜单点击事件        	
			 	$('.toggle-icon').click(function(){
				    var _this = $(this);
				    if(!$(this).hasClass('active')){
				      	$(this).parents('#budget-slide').eq(0).animate({
				        	left:'-200px'
				      	},300, function() {
				        	_this.css({
				          		"background-position": "-19px 0",
				          		"right": "-19px"
				        	}).addClass('active');
				      	});
				      	$('.layui-body').animate({
				        	left:'20px'
				      	},300);
				    }else{
				      	$(this).parents('#budget-slide').eq(0).animate({
				        	left:'0px'
					    },300, function() {
					        _this.css({
				          		"background-position": "0 0",
				          		"right": "0"
			        		}).removeClass('active');
				      	});
				      	$('.layui-body').animate({
				        	left:'220px'
				      	},300);
				    }    
				})
				//监听导航点击
				element.on('nav(test)', function(elem){
				    var link = $(elem).data('link');
					location.hash = link;
					$('.body-loading').append('<div class="content-loading tac"><i class="layui-icon layui-anim layui-anim-rotate layui-anim-loop" style="font-size: 30px; color: #666;">&#xe63d;</i> </div>');
					pathfn._pageJumpOperate(link);					
				});
				callback && callback();	
		    }; 
		    _contentOperate();
		    _menuOperate(callback);
		})
    }  
	return backFn;
});  